import { createStore } from 'vuex'

const store =  createStore({
  state: {
    musicUrl:[],
    musicName:"",
    musicArtists:""
  },
  getters: {

  },
  mutations: {
    getMusicUrl(state,{id,name,artists}) {
      state.musicUrl = `https://music.163.com/song/media/outer/url?id=${id}.mp3`
      state.musicName = name
      state.musicArtists = artists.map(artist=>{
        return artist.name
      })
    }
  },
  actions: {
  },
  modules: {
  }
})
export default store